python technical interview string processing